<?php
class Literal extends CWidget {
	public $threads;
	
	public function init() {
		$threadsIds = Options::model()->findOptionByName('literalIds');
		$threadsIds = explode(',', $threadsIds->optionValue);
		$this->threads = array();
		foreach($threadsIds as $threadId) {
			$this->threads[] = Threads::model()->findByPk($threadId);
		}
	}
	
	public function run() {
		$this->renderContent();
	}

	public function renderContent($return = false) {
		return $this->render('literal', array('threads' => $this->threads), $return);
	}
}